#!/usr/bin/env python
# -*- coding: utf-8 -*-

from typing import TYPE_CHECKING

from sqlalchemy import Boolean, Column, Integer, String, text, TIMESTAMP, DateTime
from sqlalchemy.orm import relationship

from app.db.base_class import Base


class TradeCalendar(Base):
    __tablename__ = 'tb_trade_calendar'
    id = Column(Integer, primary_key=True)
    exchange = Column(String(64))
    calDate = Column('cal_date', DateTime)
    pretradeDate = Column('pretrade_date', DateTime)
    state = Column('state', String(2))
    marketType = Column('market_type', String(2))
    createdDate = Column('created_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'))
    updatedDate = Column('updated_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))

